import React, { Component, Fragment } from 'react'
import Test from './Test'
export default class App extends Component {
  state = { c: 0, obj: { name: 'zs' } }
  render() {
    console.log('app更新了')
    return (
      <>
        <button
          onClick={() => {
            this.setState({
              c: 1,
            })
          }}
        >
          按钮1
        </button>
        <button
          onClick={() => {
            const newObj = { ...this.state.obj }
            newObj.name = 'ls'
            this.setState({
              obj: newObj,
            })
          }}
        >
          按钮2
        </button>
        <Test c={this.state.c} obj={this.state.obj}></Test>
      </>
    )
  }
}
